> library(sqldf)
Loading required package: gsubfn
Loading required package: proto
Loading required package: RSQLite
> sqldf('select * from score')
student_number semester math_score english_score
1 1 1 60 80
2 2 1 90 70
3 1 2 70 40
4 2 2 90 60
> sqldf('select * from score where student_number=1')
student_number semester math_score english_score
1 1 1 60 80
2 1 2 70 40
> sqldf('select avg(math_score), avg(english_score) from score group by student_number')
avg(math_score) avg(english_score)
1 65 60
2 90 65